import jmespath

var = {
    "locations": [
        {"name": "Seattle", "state": "WA"},
        {"name": "New York", "state": "NY"},
        {"name": "Bellevue", "state": "WA"},
        {"name": "Olympia", "state": "WA"}
    ]
}
print(jmespath.search("locations[?state == 'WA'].name", var))
